<template>
    <div>
        <h2>{{item}}</h2>
        <p>合计: {{sumNum}}</p>
        <el-button @click="nextTest">NEXT</el-button>
    </div>
</template>

<script>
    export default {

        props: [],

        components: {},

        data() {
            return {
                item: "",
                score: "",
                sumNum: 1,
                testArr: [
                    "1",
                    "2",
                    "3",
                    "4",
                    "5",
                ]
            };
        },

        created() {
            this.changeTestItem()
        },

        methods: {
            changeTestItem(){
                let testIndex = Math.floor(Math.random()*this.testArr.length);
                this.item = this.testArr[testIndex];
            },
            nextTest(){
                this.sumNum ++;
                this.changeTestItem();
                if(this.sumNum === 6) this.sumNum = 1;
                console.log("fuckkkk")
            }
        },

        computed: {}
    };
</script>

<style lang="less" type="text/less" scoped>

</style>
